<template>
  <div id="main" style="width: 600px; height: 400px">
    haohaoaho
    <section class="chart-container">
      <el-row>
        <el-col :span="12">
          <div id="letter" style="width:100%; height:400px;"></div>
        </el-col>
      </el-row>
    </section>
  </div>
</template>
<script>
import * as echarts from 'echarts';
export default {
  data() {
    return {
      letter: null,
      chartDom:null,
      myChart:null,
      option: {
        graphic: {
          elements: [
            {
              type: 'text',
              left: 'center',
              top: 'center',
              style: {
                text: 'Apache ECharts',
                fontSize: 80,
                fontWeight: 'bold',
                lineDash: [0, 200],
                lineDashOffset: 0,
                fill: 'transparent',
                stroke: '#000',
                lineWidth: 1
              },
              keyframeAnimation: {
                duration: 3000,
                loop: true,
                keyframes: [
                  {
                    percent: 0.7,
                    style: {
                      fill: 'transparent',
                      lineDashOffset: 200,
                      lineDash: [200, 0]
                    }
                  },
                  {
                    // Stop for a while.
                    percent: 0.8,
                    style: {
                      fill: 'transparent'
                    }
                  },
                  {
                    percent: 1,
                    style: {
                      fill: 'black'
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  },
  methods: {
    show(){
    this.chartDom = document.getElementById('main');
    this.myChart = echarts.init(this.chartDom);
    this.option && this.myChart.setOption(this.option);
    }
  },
  mounted: function () {
    this.show()
  },
  updated: function () {
    this.show()
  }


}
</script>